package com.Register.dto;

import com.Register.entity.PageQuery;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Objects;

@Data
@Tag(name = "分页查询志愿活动")
public class ActivityPageQueryDTO extends PageQuery implements Serializable {
    @Schema(description = "主键ID-也是活动编号")
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @Schema(description = "活动名称")
    private String activityName;

    @Schema(description = "活动组织")
    private String organization;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Schema(description = "开始时间")
    private LocalDateTime beginTime;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Schema(description = "结束时间")
    private LocalDateTime endTime;

    @Override
    public int hashCode(){
        return Objects.hash(activityName,organization,getPageNo(), getPageSize(), getSortBy(), getIsAsc());
    }
}
